package com.huiyeji.hui.service;

import com.huiyeji.hui.vo.GroupOrPrivateMessageVo;
import com.huiyeji.hui.vo.MessageVo;
import com.huiyeji.hui.vo.SystemMessageVo;

import java.util.List;

/**
 * @author zhaoduo
 */
public interface MessageService {

    /**
     * 得到所有系统消息
     * @return List<SystemMessageVo>
     */
    List<SystemMessageVo> getSystemMessages();

    /**
     * 得到某群聊消息集合
     * @param uid uid
     * @param gid gid
     * @return List<GroupOrPrivateMessageVo>
     */
    List<GroupOrPrivateMessageVo> getGroupMessages(Long uid, Long gid);

    /**
     * 得到与某好友的私聊消息
     * @param uid uid
     * @param fid fid
     * @return List<GroupOrPrivateMessageVo>
     */
    List<GroupOrPrivateMessageVo> getPrivateMessages(Long uid, Long fid);

    /**
     * 发送群聊消息
     * @param vo MessageVo
     */
    void addGroupMsg(MessageVo vo);

    /**
     * 发送私聊消息
     * @param vo MessageVo
     */
    void addPrivateMsg(MessageVo vo);

    /**
     * 得到该群聊所有消息id
     * @param gid gid
     * @return List<Long>
     */
    List<Long> getAllMessageIdOfGroup(Long gid);

    /**
     * 删除群消息表中所有群消息
     * @param gid gid
     */
    void deleteAllGroupMessage(Long gid);

    /**
     * 删除消息表中所有相关消息
     * @param midList 要删除的消息id集合
     */
    void deleteMessages(List<Long> midList);

    /**
     * 得到两好友之间发送的私聊消息 mid 集合
     * @param uid uid
     * @param fid fid
     * @return List<Long>
     */
    List<Long> getAllMessageIdOfPrivate(Long uid, Long fid);

    /**
     * 从私聊消息表中删除两位用户之间发送的消息
     * @param uid uid
     * @param fid fid
     */
    void deletePrivateMessageFromTwoUser(Long uid, Long fid);
}
